<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page isELIgnored="false"%>
<%@ include file="../common/taglibs.jsp"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="renderer" content="webkit">
<title>白名单</title>
<link rel="icon" href="favicon.ico" type="image/x-icon"/>
<!-- 当前页面样式 -->
<link rel="stylesheet" href="<s:url value="/css/common.css"/>"/>
<!-- 当前页面样式 END -->
<style type="text/css">
.blue{
	color: blue
}
</style>
<script type="text/javascript"
	src="<c:url value="/js/jquery-1.3.2.js" />"></script>
<script language="javascript" type="text/javascript"
	src="<s:url value="/js/My97DatePicker/WdatePicker.js"/>"></script>
<script type="text/javascript">
$(document).ready(function(){
		$('#sub').click(function(){
			$("#queryForm").attr("action","<%=basePath%>/whitelist/whitelistview.ct");
			$("#queryForm").submit();
			$(this).attr("disabled","true");
		});
		$('#addWhitelist').click(function(){
			$("#queryForm").attr("action","<%=basePath%>/whitelist/addwhitejsp.ct");
			$("#queryForm").submit();
		});
		$('#exportWhitelist').click(function(){
			$("#queryForm").attr("action","<%=basePath%>/whitelist/startExportJsp.ct");
			$("#queryForm").submit();
		});
	});	

	function updateStatus(whiteId)
	{		
		$("#queryForm").attr("action","<%=basePath%>/whitelist/updateWhitelistInit.ct?white.mchtId="+whiteId);
		$("#queryForm").submit();
	}
</script>
</head>

<body>
		<s:form id="queryForm" action="/whitelist/whitelistview.ct" method="post"
			theme="simple">
			<table class="tb">
				<tbody>
				<tr class="tb-line">
            		<td class="tb-td" colspan="4"><div class="tb-h2">POS收单运营管理平台</div></td>
        		</tr>
				 <tr class="tb-line">
					<td class="tb-td" colspan="4">
						<div class="tb-h3">白名单</div>
					</td>
				</tr>

				 <tr class="tb-line">
				 	<td width="12%" style="min-width: 150px" align="right" class="tb-td">
				 	 <div class="tb-h4" id="blackNum">商户号</div>
				 	 </td>
					<td class="tb-td">
                		<label class="tb-input-normal">
						<s:textfield  name="searchCondition.mchtId" cssClass="queryWidth" />
							</label>
							</td>
					<td width="12%" style="min-width: 150px" align="right" class="tb-td">
                <div class="tb-h4">商户名：</div>
            		</td>
				<td class="tb-td">
                <label class="tb-input-normal">
				<s:textfield  name="searchCondition.mchtName" cssClass="queryWidth" />
				</label>
                </td>
				</tr>
				<tr class="tb-line">
			        <td width="12%" style="min-width: 150px" align="right" class="tb-td">
                	<div class="tb-h4">状态：</div>
            		</td>
					<td class="tb-td">
                	<label class="tb-select">
						<s:select name="searchCondition.status" list="#{'0':'关闭','1':'开启'}" headerKey="" headerValue="不限" cssClass="queryWidth" /> 
					</label>
					</td>
					<td width="12%" style="min-width: 150px" align="right" class="tb-td">
                	<div class="tb-h4">时间：</div>
            		</td>
					<td class="tb-td">
                	<label class="tb-input-normal">
						<s:textfield id="minDate" name="searchCondition.date" onFocus="WdatePicker({dateFmt:'yyyyMMdd',readOnly:true,wdate:true,errDealMode:0});"
							theme="simple" cssClass="queryWidth" />
					</label>
					</td>												
				</tr>
				<tr class="tb-line">
					<td width="12%" style="min-width: 150px" align="right" class="tb-td">
                	<div class="tb-h4">操作账号：</div>
            		</td>
					<td class="tb-td">
                	<label class="tb-input-normal">
						<s:textfield name="searchCondition.accountNo" theme="simple" cssClass="queryWidth" />
					</label>
					</td>												
				</tr>
				<tr>
						<td colspan="4" align="center"><span style="color: red"><s:actionerror /></span>
							<span style="color: red;"><s:actionmessage /></span > <span style="color: red;"><s:fielderror
									cssClass="fieldError" /></span>
							<span id="otherError"></span>
						</td>
					</tr>
				 <tr class="tb-line">
           		 <td class="tb-td line-submit" align="right" colspan="4">
                <label class="tb-input-submit"><input type="button" value="查询" id="sub"/></label>
				<label class="tb-input-submit"><s:reset value="取 消" /></label> 
				<label class="tb-input-submit"><input type="button" value="添加" id="addWhitelist"/></label>
				<label class="tb-input-submit"><input type="button" value="批量导入" id="exportWhitelist"/></label>	 
				</td>
				</tr>
				
				<s:if
					test="#request.searchRsList != null && #request.searchRsList.size>0">
					<tr class="tb-line">
						<td class="tb-td paging" colspan="4"><page:pageCount
								max_pages="11" totalPage="${requestScope.totalPage}"
								currentPage="${requestScope.currentPage}"
								action="${rootPath}/whitelist/whitelistview.ct?currentPage=" />

						</td>
					</tr>
				</s:if>
			</table>
			
				
	<div class="big-tb">
    <table class="tb" style="width: 100%;">
				<thead>
            	<tr class="tb-line">
                <th class="tb-th" colspan="7"><div class="tb-h3">白名单列表</div></th>
            	</tr>
					 <tr class="tb-line bg-gray">
						<th class="tb-th" id="title">商户号</th>	
						<th class="tb-th">商户名</th>
						<th class="tb-th">操作账号</th>				
						<th class="tb-th">日期</th>
						<th class="tb-th">时间</th>
						<th class="tb-th">状态</th>
						<th class="tb-th">操作</th>
					</tr>
				</thead>
				<tbody>
					<s:iterator value="#request.searchRsList" status="stat" id="bean">
							<tr class="tb-line" >
							<td class="tb-td"><s:property value="#bean.mchtId"/></td>
							<td class="tb-td"><s:property value="#bean.mchtName"/></td>
							<td class="tb-td" align="center"><s:property value="#bean.opr"/></td>
							<td class="tb-td" align="center"><s:property value="#bean.date"/></td>
							<td class="tb-td" align="center"><s:property value="#bean.time"/></td>
							<td class="tb-td">
							<s:if test="#bean.status==0">关闭</s:if>
							<s:elseif test="#bean.status==1">开启</s:elseif>
							</td>
							<td align="center">
							<a href="javascript:updateStatus(<s:property value="#bean.mchtId"/>)" class="blue">修改</a>
							</td>
						</s:iterator>
				</tbody>
			</table>
			</div>
		</s:form>
	<s:if test="#request.info_request !=null">
	<script language="javascript">
	    alert("${request.info_request}");
	    </script>
	</s:if>	
</body>
</html>
